<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是图片格式——JPEG协议介绍的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV01-图像-03-图片格式-03-03-JPEG协议介绍">
<meta property="og:url" content="https://sumumm.github.io/post/209e45b7.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是图片格式——JPEG协议介绍的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074043718.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074226505.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074328368.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/format-30x13.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725075107599.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074235919.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074235919.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074235919.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074942254.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727093445827.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727091512156.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727093516502.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240729075256730.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727104257900.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727093046246.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727105201634.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727105617732.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728093412783.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728093813473.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728095450833.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728101513739.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728101645437.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728101719062.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728102229429.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240730073730286.png">
<meta property="article:published_time" content="2024-07-29T23:49:13.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.063Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="(ALPHA)LV01-图像基础知识">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074043718.png">


<link rel="canonical" href="https://sumumm.github.io/post/209e45b7.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":"","permalink":"https://sumumm.github.io/post/209e45b7.html","path":"post/209e45b7.html","title":"LV01-图像-03-图片格式-03-03-JPEG协议介绍"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV01-图像-03-图片格式-03-03-JPEG协议介绍 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81JPEGsnoop"><span class="nav-text">一、JPEGsnoop</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E7%AE%80%E4%BB%8B"><span class="nav-text">1. 简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E4%B8%8B%E8%BD%BD%E4%B8%8E%E5%AE%89%E8%A3%85"><span class="nav-text">2. 下载与安装</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81JPEG%E6%96%87%E4%BB%B6%E4%B8%AD%E6%AE%B5%E7%9A%84%E6%A6%82%E5%BF%B5"><span class="nav-text">二、JPEG文件中段的概念</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E5%A6%82%E4%BD%95%E8%AF%86%E5%88%ABJPEG%E6%96%87%E4%BB%B6%EF%BC%9F"><span class="nav-text">1. 如何识别JPEG文件？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E6%AE%B5%E7%BB%93%E6%9E%84"><span class="nav-text">2. 段结构</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%AE%B5%E7%9A%84%E6%A0%87%E8%AF%86%E4%B8%8E%E7%B1%BB%E5%9E%8B"><span class="nav-text">3. 段的标识与类型</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E6%AE%B5%E7%9A%84%E9%95%BF%E5%BA%A6"><span class="nav-text">4. 段的长度</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E4%B8%80%E8%88%AC%E6%9C%89%E5%93%AA%E4%BA%9B%E6%AE%B5%EF%BC%9F"><span class="nav-text">三、一般有哪些段？</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-SOI-FFD8-%E2%80%94%E2%80%94%E6%96%87%E4%BB%B6%E5%A4%B4"><span class="nav-text">1. SOI(FFD8)——文件头</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">1.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">1.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-APP0-FFE0-%E2%80%94%E2%80%94%E5%9B%BE%E5%83%8F%E8%AF%86%E5%88%AB%E4%BF%A1%E6%81%AF"><span class="nav-text">2. APP0(FFE0)——图像识别信息</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">2.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">2.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-DQT-FFDB-%E2%80%94%E2%80%94%E5%AE%9A%E4%B9%89%E9%87%8F%E5%8C%96%E8%A1%A8"><span class="nav-text">3. DQT(FFDB)——定义量化表</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">3.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E7%BC%96%E7%A0%81%E8%B4%A8%E9%87%8F%E6%8E%A7%E5%88%B6"><span class="nav-text">3.2 编码质量控制</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">3.3 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-SOF0-FFC0-%E2%80%94%E2%80%94%E5%9B%BE%E5%83%8F%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="nav-text">4. SOF0(FFC0)——图像基本信息</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">4.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">4.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-DHT-FFC4-%E2%80%94%E2%80%94%E5%AE%9A%E4%B9%89huffman%E8%A1%A8"><span class="nav-text">5. DHT(FFC4)——定义huffman表</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#5-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">5.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">5.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-SOS-FFDA-%E2%80%94%E2%80%94%E6%89%AB%E6%8F%8F%E8%A1%8C%E5%BC%80%E5%A7%8B"><span class="nav-text">6. SOS(FFDA)——扫描行开始</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#6-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">6.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">6.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-EOI-FFD9-%E2%80%94%E2%80%94%E6%96%87%E4%BB%B6%E5%B0%BE"><span class="nav-text">7. EOI(FFD9)——文件尾</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#7-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">7.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">7.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-DRI-FFDD-%E2%80%94%E2%80%94%E5%AE%9A%E4%B9%89%E9%87%8D%E6%96%B0%E5%BC%80%E5%A7%8B%E9%97%B4%E9%9A%94"><span class="nav-text">8. DRI(FFDD)——定义重新开始间隔</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#8-1-%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84"><span class="nav-text">8.1 基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#8-2-%E5%AE%9E%E4%BE%8B%E5%88%86%E6%9E%90"><span class="nav-text">8.2 实例分析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#9-%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A0%BC%E5%BC%8F"><span class="nav-text">9. 扫描数据格式</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%9B%9B%E3%80%81JPEG%E6%A0%87%E5%87%86%E4%B8%8E%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F"><span class="nav-text">四、JPEG标准与文件格式</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%94%E3%80%81%E5%A4%9ASlice%E6%8B%BC%E6%8E%A5"><span class="nav-text">五、多Slice拼接</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/209e45b7.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV01-图像-03-图片格式-03-03-JPEG协议介绍 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV01-图像-03-图片格式-03-03-JPEG协议介绍
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-07-30 07:49:13" itemprop="dateCreated datePublished" datetime="2024-07-30T07:49:13+08:00">2024-07-30</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/" itemprop="url" rel="index"><span itemprop="name">04音视频</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" itemprop="url" rel="index"><span itemprop="name">LV01-图像基础知识</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>8.3k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>30 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是图片格式——JPEG协议介绍的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" rowspan="5">PC端开发环境</td>        <td align="center" width=150px>Windows</td>        <td align="left">Windows11</td>    </tr>    <tr>        <td align="center">Ubuntu</td>        <td align="left">Ubuntu20.04.6的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 17 Pro</td>        <td align="left">17.0.0 build-20800274</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>    </tr>    <tr>        <td align="center">Win32DiskImager</td>        <td align="left">Win32DiskImager v1.0</td>      </tr>    <tr>        <td align="center" rowspan="3">Linux开发板环境</td>        <td align="center">Linux开发板</td>        <td align="left">正点原子 i.MX6ULL Linux 阿尔法开发板</td>      </tr>    <tr>        <td align="center">uboot</td>        <td align="left">NXP官方提供的uboot，NXP提供的版本为uboot-imx-rel_imx_4.1.15_2.1.0_ga(使用的uboot版本为U-Boot 2016.03)</td>      </tr>    <tr>        <td align="center">linux内核</td>        <td align="left">linux-4.15(NXP官方提供)</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <ul><li>通用</li></ul><table>    <tr><td align="center">参考资料  </td><td align="center">相关链接</td></tr>    <tr><td align="left">JPEG官网？</td><td align="left"><a href="https://jpeg.org/jpeg/index.html" target="_blank">jpeg.org<i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left" rowspan="2">JPEG文件格式参考文档</td><td align="left"><a href="https://www.ijg.org/files/T-REC-T.871-201105-I!!PDF-E.pdf" target="_blank">JPEG File Interchange Format (JFIF) ---在线文档<i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left"><a href="./参考资料/T-REC-T.871-201105-I!!PDF-E.pdf" target="_blank">JPEG File Interchange Format (JFIF) ---本地文档<i class="fa fa-external-link-alt"></i> </a></td></tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr><td align="left"><a href="" target="_blank">---</a></td><td align="left">---</td></tr></table>
              </div>
            </details>

<p>这一节的笔记我们来学习JPEG文件的格式。</p>
<h1 id="一、JPEGsnoop"><a href="#一、JPEGsnoop" class="headerlink" title="一、JPEGsnoop"></a><font size=3>一、JPEGsnoop</font></h1><h2 id="1-简介"><a href="#1-简介" class="headerlink" title="1. 简介"></a><font size=3>1. 简介</font></h2><p>JPEGsnoop是一个详细的JPEG图像解码器和分析工具。它报告所有图像元数据，甚至可以帮助识别图像是否被编辑过。它有以下特点（这里我就没翻译了）：</p>
<ul>
<li>Decode JPEG, AVI (MJPG), PSD images</li>
<li>MCU analysis with detailed decode</li>
<li>Extract embedded JPEG images</li>
<li>Detect edited images through compression signature analysis</li>
<li>Report all image metadata (EXIF)</li>
<li>Batch file processing</li>
<li>Compression signature detection</li>
<li>Recover corrupt JPEG image data</li>
<li>No installation required</li>
</ul>
<p>官方Github仓库应该是这个：<a target="_blank" rel="noopener" href="https://github.com/ImpulseAdventure/JPEGsnoop/">GitHub - ImpulseAdventure&#x2F;JPEGsnoop: JPEGsnoop: JPEG decoder and detailed analysis</a></p>
<h2 id="2-下载与安装"><a href="#2-下载与安装" class="headerlink" title="2. 下载与安装"></a><font size=3>2. 下载与安装</font></h2><p>我们下载一下安装包，可以直接从发布版本中找：<a target="_blank" rel="noopener" href="https://github.com/ImpulseAdventure/JPEGsnoop/releases">Releases · ImpulseAdventure&#x2F;JPEGsnoop (github.com)</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074043718.png" alt="image-20240725074043718" style="zoom:41%;" />

<p>我们直接下载第一个好了，下载后解压，可以得到这样一个文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074226505.png" alt="image-20240725074226505" style="zoom:50%;" />

<p>这个软件是免安装的，直接双击打开即可。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725074328368.png" alt="image-20240725074328368" style="zoom:47%;" />

<p>我们打开一个jpeg文件看一下，我们这里就用之前自己生成的jpg文件，像素点少，后面可以更好的查看数据：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/format-30x13.jpg" alt="format-30x13" />

<p>打开后如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240725075107599.png" alt="image-20240725075107599" style="zoom:50%;" />

<h1 id="二、JPEG文件中段的概念"><a href="#二、JPEG文件中段的概念" class="headerlink" title="二、JPEG文件中段的概念"></a><font size=3>二、JPEG文件中段的概念</font></h1><h2 id="1-如何识别JPEG文件？"><a href="#1-如何识别JPEG文件？" class="headerlink" title="1. 如何识别JPEG文件？"></a><font size=3>1. 如何识别JPEG文件？</font></h2><p>我们平时是靠<code>.jpg</code>、<code>.jpeg</code>等后缀名来识别，看到这个后缀，我们就认为是一张JPEG图片，但是还是会有一些图片是没有后缀的，依然能被识别，这是怎么做的呢？</p>
<p>其实很简单，就是判断前面3个字节是什么，如果发现是FF D8 FF开始，那就认为它是JEPG图片。JPG文件是由一段段的数据构成的组成的（segment），段的多少和长度并不是一定的。只要包含了足够的信息，该JPEG文件就能够被打开。</p>
<h2 id="2-段结构"><a href="#2-段结构" class="headerlink" title="2. 段结构"></a><font size=3>2. 段结构</font></h2><p>上面了解到JPEG 文件的格式是分为一个一个的段来存储的，段的多少和长度并不是一定的。只要包含了足够的信息，该JPEG文件就能够被打开，呈现给我们。接下来我们就开始学习一下段的相关基础知识。</p>
<p>JPEG文件的每个段都一定包含两部分：一个是段的标识，它由两个字节构成：第一个字节是十六进制0xFF，第二个字节对于不同的段，这个值是不同的。紧接着的两个字节存放的是这个段的长度（除了前面的两个字节0xFF和0xXX，X表示不确定。他们是不算到段的长度中的）。</p>
<p>注意：这个长度的表示方法是按照高位在前，低位在后的，与 Intel 的表示方法不同。比方说一个段的长度是0x12AB，那么它会按照0x12，0xAB的顺序存储。但是如果按照Intel的方式：高位在后，低位在前的方式会存储成0xAB，0x12，而这样的存储方法对于JPEG是不对的。这样的话如果一个程序不认识JPEG文件某个段，它就可以读取后两个字节，得到这个段的长度，并跳过忽略它。</p>
<p>段的一般结构如下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074235919.png" alt="image-20240726074235919" />

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">-----------------------------------------------------------------</span><br><span class="line">名称   字节数      数据     说明</span><br><span class="line">-----------------------------------------------------------------</span><br><span class="line">段标识   1         FF      每个新段的开始标识</span><br><span class="line">段类型   1                 类型编码（称作“标记码”）</span><br><span class="line">段长度   2                 包括段内容和段长度本身,不包括段标识和段类型</span><br><span class="line">段内容                     ≤65533字节</span><br><span class="line">————————————————</span><br></pre></td></tr></table></figure>

<p>①JPG 文件中所有关于宽度高度长度间隔这一类数据，凡是＞１字节的，均采用Motorola格式，即：高位在前，低位在后。</p>
<p>②有些段没有长度描述也没有内容，只有段标识和段类型。文件头和文件尾均属于这种段。</p>
<p>③段与段之间无论有多少FF都是合法的，这些FF称为“填充字节”，必须被忽略掉。</p>
<h2 id="3-段的标识与类型"><a href="#3-段的标识与类型" class="headerlink" title="3. 段的标识与类型"></a><font size=3>3. 段的标识与类型</font></h2><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074235919.png" alt="image-20240726074235919" />

<p>它由两个字节构成：第一个字节是段标识0xFF，第二个字节是段类型（对于不同的段是不同的），具体如下：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">段类型   表示符号      说明</span><br><span class="line">——————————————————————————————————</span><br><span class="line">SOI      D8          文件头(必须)</span><br><span class="line"></span><br><span class="line">APP0     E0          定义交换格式和图像识别信息(非必需)</span><br><span class="line">APP1     E1          同上</span><br><span class="line">....    ....         .... </span><br><span class="line">APPn     En          同上</span><br><span class="line"></span><br><span class="line">DQT      DB          定义量化表(必须)</span><br><span class="line"></span><br><span class="line">SOF0     C0          图像基本信息</span><br><span class="line">SOF1     C1          同上</span><br><span class="line">....    ....         ....</span><br><span class="line">SOFn     Cn          同上</span><br><span class="line"></span><br><span class="line">DHT      C4          定义 Huffman 表（霍夫曼表）</span><br><span class="line">DRI      DD          定义重新开始间隔(非必需)</span><br><span class="line">SOS      DA          扫描行开始</span><br><span class="line">COM      FE          注释(非必需)</span><br><span class="line">EOI      D9          文件尾</span><br><span class="line">......</span><br></pre></td></tr></table></figure>

<p>段类型大概有30种，但上面那些是必须被所有程序识别的，其它的类型都可以忽略。</p>
<blockquote>
<p>常见的段：</p>
<ol>
<li>SOI（必须）：SOI段定义了文件头。该段仅有两个字节：FF D8，这两个字节代表了JPEG文件的开始。</li>
<li>APP0, APP1, APP2….（必须）：APP0段定义了交换格式和图像识别信息。包含了一些像素和略缩图相关的信息。</li>
<li>DQT（必须）：DQT段定义了量化表。JPEG文件一般有两个DQT段，为亮度定义１个, 为色度定义１个。</li>
<li>SOF0, SOF1, SOF2….（必须）：SOF段定义了图像基本信息。包含了一些图片长宽高、组件等信息。</li>
<li>DHT（必须） ：DHT段定义了Huffman表，即霍夫曼编码表。</li>
<li>DRI（<strong>非必须</strong>）：DRI段定义了重新开始间隔，很多JPEG文件没有这个段。</li>
<li>SOS（必须）：SOS段定义了扫描行开始，紧接着SOS段后的就是一个个扫描行（压缩的图像数据）。</li>
<li>COM（<strong>非必须</strong>）：COM段定义了注释段，有的JPEG文件没有这个段。</li>
<li>EOI（必须）：EOI段定义了文件尾，该段仅有两个字节：FF D9，这两个字节代表了JPEG文件的结束。</li>
</ol>
</blockquote>
<h2 id="4-段的长度"><a href="#4-段的长度" class="headerlink" title="4. 段的长度"></a><font size=3>4. 段的长度</font></h2><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074235919.png" alt="image-20240726074235919" />

<p>紧接着的两个字节存放的是这个段的长度（除了前面的两个字节0xFF和0xXX，X表示不确定。他们是不算到段的长度中的）。其作用是这样的话如果一个程序不认识JPEG文件某个段，它就可以读取后两个字节，得到这个段的长度，并跳过忽略它。</p>
<h1 id="三、一般有哪些段？"><a href="#三、一般有哪些段？" class="headerlink" title="三、一般有哪些段？"></a><font size=3>三、一般有哪些段？</font></h1><h2 id="1-SOI-FFD8-——文件头"><a href="#1-SOI-FFD8-——文件头" class="headerlink" title="1. SOI(FFD8)——文件头"></a><font size=3>1. SOI(FFD8)——文件头</font></h2><h3 id="1-1-基本结构"><a href="#1-1-基本结构" class="headerlink" title="1.1 基本结构"></a><font size=3>1.1 基本结构</font></h3><p>JPEG文件的开始2个字节都是FF D8这是JPEG协议规定的：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">-----------------</span><br><span class="line">名称  字节数 值</span><br><span class="line">-----------------</span><br><span class="line">段标识   1     FF</span><br><span class="line">段类型   1     D8 </span><br><span class="line">-----------------</span><br></pre></td></tr></table></figure>

<h3 id="1-2-实例分析"><a href="#1-2-实例分析" class="headerlink" title="1.2 实例分析"></a><font size=3>1.2 实例分析</font></h3><p>我们可以打开之前准备的那个format-30x13.jpg文件看一下：</p>
<p><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240726074942254.png" alt="image-20240726074942254"></p>
<p>我们可以使用JPEGsnoop工具打开图片看一下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727093445827.png" alt="image-20240727093445827" style="zoom:50%;" />

<h2 id="2-APP0-FFE0-——图像识别信息"><a href="#2-APP0-FFE0-——图像识别信息" class="headerlink" title="2. APP0(FFE0)——图像识别信息"></a><font size=3>2. APP0(FFE0)——图像识别信息</font></h2><h3 id="2-1-基本结构"><a href="#2-1-基本结构" class="headerlink" title="2.1 基本结构"></a><font size=3>2.1 基本结构</font></h3><p>APP0的基本结构如下：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">--------------------------------------------------------------------------</span><br><span class="line">名称      字节数        值                   说明</span><br><span class="line">--------------------------------------------------------------------------</span><br><span class="line">段标识       1         FF</span><br><span class="line">段类型       1         E0</span><br><span class="line">段长度       2         00 10               如果有RGB缩略图就＝16＋3n</span><br><span class="line"></span><br><span class="line">（以下为段内容）</span><br><span class="line">交换格式      5        4A46494600          “JFIF”的ASCII码</span><br><span class="line">主版本号      1</span><br><span class="line">次版本号      1  </span><br><span class="line">密度单位      1        0=无单位；1=点数/英寸；2=点数/厘米</span><br><span class="line">X像素密度     2                             水平方向的密度   </span><br><span class="line">Y像素密度     2                             垂直方向的密度</span><br><span class="line">缩略图X像素   1                             缩略图水平像素数目  </span><br><span class="line">缩略图Y像素   1                             缩略图垂直像素数目</span><br><span class="line"></span><br><span class="line">（如果“缩略图X像素”和“缩略图Y像素”的值均＞0，那么才有下面的数据）</span><br><span class="line">RGB缩略图    3×n      n＝缩略图像素总数＝缩略图X像素×缩略图Y像素</span><br><span class="line">--------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>

<p>（1）JFIF是JPEG File Interchange Forma的缩写，即JPEG文件交换格式，另外还有TIFF等格式，很少用。</p>
<p>（2）“如果有RGB缩略图就＝16＋3n”是什么意思呢？比如说“缩略图X像素”和“缩略图Y像素”的值均为48，就表示有一个48×48像素的缩略图（ｎ＝48×48），缩略图是24位真彩位图，用３个字节来表示一个像素，所以共占用3n个字节。但大多数JPG文件都没有这个“鸡肋”缩略图。</p>
<h3 id="2-2-实例分析"><a href="#2-2-实例分析" class="headerlink" title="2.2 实例分析"></a><font size=3>2.2 实例分析</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727091512156.png" alt="image-20240727091512156" />

<p>（1）图像识别信息头：2个字节FF E0。</p>
<p>（2）段长度：00 10 也就是16个字节。</p>
<p>（3）交换格式5个字节：4A 46 49 46 00，此处代表‘JFIF’，一般我们用的都是JFIF的jpeg交换格式，但是也有TFIF的jpeg交换格式，如果camera sensor直接输出的是jpeg图片，那么在其sensor寄存器可以设置使用JFIF还是TFIF。</p>
<p>（4）主版本号和次版本号一共2个字节： 01 01 说明主版本号和此版本号都为1。</p>
<p>（5）单位密度1个字节：01 表示此处使用的是点数&#x2F;英寸。</p>
<p>（6）X像素密度2个字节：00 a8表示水平像素密度是168。</p>
<p>（7）Y像素密度2个字节：00 a8表示垂直像素密度是168。</p>
<p>（8）缩略图X像素：00 表示没有缩略图。</p>
<p>（9）缩略图Y像素：00 表示没有缩略图。</p>
<p>（10）RGB缩略图：此处没有缩略图，所以是空的。</p>
<p>可以拿JPEGsnoop工具打开验证一下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727093516502.png" alt="image-20240727093516502" style="zoom:50%;" />



<h2 id="3-DQT-FFDB-——定义量化表"><a href="#3-DQT-FFDB-——定义量化表" class="headerlink" title="3. DQT(FFDB)——定义量化表"></a><font size=3>3. DQT(FFDB)——定义量化表</font></h2><h3 id="3-1-基本结构"><a href="#3-1-基本结构" class="headerlink" title="3.1 基本结构"></a><font size=3>3.1 基本结构</font></h3><p>DQT，Define Quantization Table量化表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">--------------------------------------------------------------------------</span><br><span class="line">名称    字节数   值       说明</span><br><span class="line">--------------------------------------------------------------------------</span><br><span class="line">段标识    1     FF</span><br><span class="line">段类型    1     DB</span><br><span class="line">段长度    2     43       其值＝3+n（当只有一个QT时）</span><br><span class="line"></span><br><span class="line">（以下为段内容）</span><br><span class="line">QT信息   1     [0:3]位：QT号 [4:7]位：QT精度（0=8bit，1字节；否则=16bit，2字节）</span><br><span class="line">QT      n               n＝64×QT精度的字节数</span><br><span class="line">--------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>

<p>（1）JPEG文件一般有２个DQT段，为Y值（亮度）定义１个, 为C值（色度）定义１个。</p>
<p>（2）一个DQT段可以包含多个QT， 每个都有自己的信息字节。QT一般是64&#x2F;128Byte，精度为8位时64Byte，最多包含4个 表。</p>
<h3 id="3-2-编码质量控制"><a href="#3-2-编码质量控制" class="headerlink" title="3.2 编码质量控制"></a><font size=3>3.2 编码质量控制</font></h3><p>使用不同的量化表可以对JPEG的编码质量进行控制：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240729075256730.png" alt="image-20240729075256730" style="zoom:50%;" />

<h3 id="3-3-实例分析"><a href="#3-3-实例分析" class="headerlink" title="3.3 实例分析"></a><font size=3>3.3 实例分析</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727104257900.png" alt="image-20240727104257900" />

<p>可以看到这里有两个量化表，此处有2个DQT数据，第一个是亮度的，第二个是色度的。以第一个亮度的为例：</p>
<p>（1）定义量化表的头2个字节：FF DB</p>
<p>（2）段长度2个字节：00 43就是3(段长度2个字节，QT信息1个字节)+QT量化表的长度，此处QT量化表的长度是64</p>
<p>（3）QT信息1个字节：以第一个量化表为例子00中0-3位是QT号，4-7位QT精度，此处是0，所以精度是8bit，即1个字节。以第二个量化表为例子 01就表示QT号是1，精度是8bit。</p>
<p>（4）QT量化表：这个的长度是根据QT信息确定的，上面QT精度为8bit，所以此处是64×1 &#x3D; 64个字节<br>我们使用前面的JPEGsnoop工具打开看一下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727093046246.png" alt="image-20240727093046246" style="zoom:50%;" />

<h2 id="4-SOF0-FFC0-——图像基本信息"><a href="#4-SOF0-FFC0-——图像基本信息" class="headerlink" title="4. SOF0(FFC0)——图像基本信息"></a><font size=3>4. SOF0(FFC0)——图像基本信息</font></h2><h3 id="4-1-基本结构"><a href="#4-1-基本结构" class="headerlink" title="4.1 基本结构"></a><font size=3>4.1 基本结构</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">--------------------------------------------------------------------------</span><br><span class="line">名称    字节数  值       说明</span><br><span class="line">--------------------------------------------------------------------------</span><br><span class="line">段标识    1     FF</span><br><span class="line">段类型    1     C0</span><br><span class="line">段长度    2             其值＝8＋组件数量×3</span><br><span class="line"></span><br><span class="line">（以下为段内容）</span><br><span class="line">样本精度  1      8       每个样本位数（大多数软件不支持12和16）</span><br><span class="line">图片高度  2</span><br><span class="line">图片宽度  2</span><br><span class="line">组件数量  1      3       1＝灰度图，3＝YCbCr/YIQ 彩色图，4＝CMYK 彩色图</span><br><span class="line"></span><br><span class="line">（以下每个组件占用３字节）</span><br><span class="line">组件 ID  1               1＝Y, 2＝Cb, 3＝Cr, 4＝I, 5＝Q</span><br><span class="line">采样系数  1               0－3位：垂直采样系数,4－7位：水平采样系数</span><br><span class="line">量化表号  1</span><br><span class="line">---------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>

<p>（1）JPEG大都采用YCrCb色彩模型（Y表示亮度，Cr红色分量，Cb表示蓝色分量），所以组件数量一般＝3</p>
<p>（2）样本就是单个像素的颜色分量，也可理解为一个样本就是一个组件.</p>
<p>（3）采样系数是实际采样方式与最高采样系数之比，而最高采样系数一般＝0.5（分数表示为1&#x2F;2）。比如说，垂直采样系数＝2，那么2×0.5＝1，表示实际采样方式是每个点采一个样，也就是逐点采样；如果垂直采样系数＝1，那么：1×0.5＝0.5（分数表示为1&#x2F;2），表示每２个点采一个样</p>
<h3 id="4-2-实例分析"><a href="#4-2-实例分析" class="headerlink" title="4.2 实例分析"></a><font size=3>4.2 实例分析</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727105201634.png" alt="image-20240727105201634" />

<p>（1）图像基本信息的：2个字节FF C0</p>
<p>（2）段长度2个字节：00 11 就是 17 &#x3D; 8 + 3*3，说明组件数量有3个。</p>
<p>（3）样本精度1个字节：08，每个样本的信息是8bit。</p>
<p>（4）样本高度2个字节：00 0d &#x3D; 13，图片高度与实际一致。</p>
<p>（5）样本宽度2个字节：00 1e &#x3D; 30，图片宽度与实际一致。</p>
<p>（6）组件数量1个字节：03 代表YCbCr 彩色图，有3个组件分别是Y、Cb、Cr。</p>
<p>（7）每个组件占用3个字节：第一个字节是组件ID，第二个字节是采样系数，第三个字节是量化表号。此处是：</p>
<p>01 22 00 表示 Y组件，垂直采样系数和水平采样系数都是2，量化表号是0；02 11 01表示 Cb组件，垂直采样系数和水平采样系数都是1，量化表号是1；03 11 01表示 Cr组件，垂直采样系数和水平采样系数都是1，量化表号是1。此处可知此处Y采样是逐点采样，CbCr都是隔点采样，这就是标准的YUV422的数据。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240727105617732.png" alt="image-20240727105617732" style="zoom:50%;" />

<h2 id="5-DHT-FFC4-——定义huffman表"><a href="#5-DHT-FFC4-——定义huffman表" class="headerlink" title="5. DHT(FFC4)——定义huffman表"></a><font size=3>5. DHT(FFC4)——定义huffman表</font></h2><h3 id="5-1-基本结构"><a href="#5-1-基本结构" class="headerlink" title="5.1 基本结构"></a><font size=3>5.1 基本结构</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">--------------------------------------------------------------------------</span><br><span class="line">名称    字节数   值       说明</span><br><span class="line">--------------------------------------------------------------------------</span><br><span class="line">段标识    1     FF</span><br><span class="line">段类型    1     C4</span><br><span class="line">段长度    2              其值＝19＋n（当只有一个HT表时）</span><br><span class="line"></span><br><span class="line">（以下为段内容）</span><br><span class="line">HT信息   1               [0:3]位:HT号; [4]位:HT类型, 0＝DC表，1＝AC表; [5:7]位：必须＝0</span><br><span class="line">HT位表   16              这16个数的和应该≤256，分别表示1-16bit位数码字的数量</span><br><span class="line">HT值表   n               n＝表头16个数的和</span><br><span class="line">--------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>

<p>（1）JPEG文件里有２类Haffman 表：一类用于DC（直流量），一类用于AC（交流量）。一般有４个表：亮度的DC和AC，色度的DC和AC，最多可有６个。</p>
<p>（2）一个DHT 段可以包含多个HT表, 每个都有自己的信息字节</p>
<p>（3）HT表是一个按递增次序代码长度排列的符号表。</p>
<h3 id="5-2-实例分析"><a href="#5-2-实例分析" class="headerlink" title="5.2 实例分析"></a><font size=3>5.2 实例分析</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728093412783.png" alt="image-20240728093412783" />

<p>（1）定义Huffman表头2个字节：FF C4</p>
<p>（2）段长度2个字节：以①为例子 00 1F就是31 &#x3D; 19(段长度2个字节+HT信息1个字节+HT位表16个字节) + 12(这个数代表HT表有12个字节)</p>
<p>（3）HT信息1个字节：[0:3]位是HT号，[4]位是HT类型(0&#x3D;DC表，1＝AC表)，[5:]7位必须为0。①中 00 表示 HT号是0，DC表；②中 10 表示 HT号是0，AC表；以③为例子 01 表示 HT号是1，DC表；④中 11表示 HT号是1，AC表。此处一共有4个Haffman 表，亮度DC Haffman 表，亮度AC Haffman 表，色度DC Haffman 表，色度AC Haffman 表</p>
<p>（4）HT位表16个字节：这16个数字值和小于等于256。①中 00 01 05 01 01 01 01 01 01 00 00 00 00 00 00 00 共16个字节，加起来是12(此处和段长度是相匹配的)，说明HT表有12个字节。</p>
<p>（5）HT值表：以①为例子00 01 02 03 04 05 06 07 08 09 0A 0B。</p>
<p>我们使用JPEGsnoop工具打开看一下，</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728093813473.png" alt="image-20240728093813473" style="zoom:50%;" />

<h2 id="6-SOS-FFDA-——扫描行开始"><a href="#6-SOS-FFDA-——扫描行开始" class="headerlink" title="6. SOS(FFDA)——扫描行开始"></a><font size=3>6. SOS(FFDA)——扫描行开始</font></h2><h3 id="6-1-基本结构"><a href="#6-1-基本结构" class="headerlink" title="6.1 基本结构"></a><font size=3>6.1 基本结构</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">--------------------------------------------------------------------------</span><br><span class="line">名称            字节数    值       说明</span><br><span class="line">--------------------------------------------------------------------------</span><br><span class="line">段标识            1      FF</span><br><span class="line">段类型            1      DA</span><br><span class="line">段长度            2      000C    其值＝6＋2×扫描行内组件数量</span><br><span class="line"></span><br><span class="line">（以下为段内容）</span><br><span class="line">扫描行内组件数量    1      3       必须≥1，≤4（否则错误），通常＝3</span><br><span class="line"></span><br><span class="line">（以下每个组件占用２字节）</span><br><span class="line">组件ID            1     1 = Y, 2 = Cb, 3 = Cr, 4 = I, 5 = Q</span><br><span class="line">Huffman表号       1              [0:3]位：AC表号 (其值＝0...3); [4:7]位：DC表号(其值＝0...3)</span><br><span class="line">剩余3个字节        3              最后３个字节用途不明，忽略</span><br><span class="line">--------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>

<p>紧接SOS段后的是压缩的图像数据（一个个扫描行），数据存放顺序是从左到右、从上到下。</p>
<h3 id="6-2-实例分析"><a href="#6-2-实例分析" class="headerlink" title="6.2 实例分析"></a><font size=3>6.2 实例分析</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728095450833.png" alt="image-20240728095450833" />

<p>（1）扫描行开始的头，2个字节：FF DA</p>
<p>（2）段长度2个字节：00 0C 就是 12 &#x3D; 6(2个字节的扫描行开始头+1个字节扫描行内组件数量+3个字节的剩余位) + 2×3(扫描行内组件数量，每个组件2个字节)</p>
<p>（3）扫描行内组件数量1个字节：03 代表组件数量数3</p>
<p>（4）每个组件占用2个字节：第一个字节是组件ID(1 &#x3D; Y, 2 &#x3D; Cb, 3 &#x3D; Cr, 4 &#x3D; I, 5 &#x3D; Q)；第二个字节[0:3]位AC表号，[4:7]位DC表号。表号的值是0-3。01 00 表示 Y组件，AC表号是0，DC表号是0；02 11表示 Cb组件，AC表号是1，DC表号是1；03 11 表示 Cr组件，AC表号是1，DC表号是1。此处跟DHT（定义Huffman表）的HT信息是一致的。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728101513739.png" alt="image-20240728101513739" style="zoom:50%;" />

<h2 id="7-EOI-FFD9-——文件尾"><a href="#7-EOI-FFD9-——文件尾" class="headerlink" title="7. EOI(FFD9)——文件尾"></a><font size=3>7. EOI(FFD9)——文件尾</font></h2><h3 id="7-1-基本结构"><a href="#7-1-基本结构" class="headerlink" title="7.1 基本结构"></a><font size=3>7.1 基本结构</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">------------------</span><br><span class="line">名称  字节数   值</span><br><span class="line">------------------</span><br><span class="line">段标识   1     FF</span><br><span class="line">段类型   1     D9 </span><br><span class="line">------------------</span><br></pre></td></tr></table></figure>

<h3 id="7-2-实例分析"><a href="#7-2-实例分析" class="headerlink" title="7.2 实例分析"></a><font size=3>7.2 实例分析</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728101645437.png" alt="image-20240728101645437" />

<p>这个就没啥好说的了，就在文件结尾。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728101719062.png" alt="image-20240728101719062" style="zoom:50%;" />

<h2 id="8-DRI-FFDD-——定义重新开始间隔"><a href="#8-DRI-FFDD-——定义重新开始间隔" class="headerlink" title="8. DRI(FFDD)——定义重新开始间隔"></a><font size=3>8. DRI(FFDD)——定义重新开始间隔</font></h2><h3 id="8-1-基本结构"><a href="#8-1-基本结构" class="headerlink" title="8.1 基本结构"></a><font size=3>8.1 基本结构</font></h3><p>DRI, Define Restart Interval，复位的间隔：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">--------------------------------------------------------------------------</span><br><span class="line">名称    字节数   值   说明</span><br><span class="line">--------------------------------------------------------------------------</span><br><span class="line">段标识    1     FF</span><br><span class="line">段类型    1     DD</span><br><span class="line">段长度    2     4 </span><br><span class="line"></span><br><span class="line">（以下为段内容）</span><br><span class="line">开始间隔   2     n   复位标记的间隔距离</span><br><span class="line">---------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>

<p>（1）开始间隔表示在压缩数据流中，每隔ｎ个MCU 块就有一个RST标记，RST标记将Huffman 的解码数据流复位，DC也重新从０开始，因此，RST标记是一种复位标记。（表示每隔多少个MCU 重置一次差分编码值，一组MCU称为一个slice，可独立解码， 多个slice之间通过RSTn进行分割）。</p>
<p>（2）RST 标记是一种特殊的段，它只具有段标识和段类型（长度＝２字节），但它不是独立的段，只能穿插在数据流中（文件头和文件尾段也只有段标识和段类型，却都是独立的段）。</p>
<p>（3）RST标记共有８个（RST0－RST7），从RST0起开始使用，然后是RST1….直至RST7，再从RST0重复。</p>
<p>（4）RST标记的标识码是 FFD0－FFD7，对应 RST0－RST7。</p>
<blockquote>
<p>说明：这个不是必须段，很多JPEG都没有。</p>
</blockquote>
<h3 id="8-2-实例分析"><a href="#8-2-实例分析" class="headerlink" title="8.2 实例分析"></a><font size=3>8.2 实例分析</font></h3><p>之前用的jpg图片没有这个信息，网上找了个，但是只有截图，没见原图，这里参考一下好啦：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240728102229429.png" alt="image-20240728102229429" />

<h2 id="9-扫描数据格式"><a href="#9-扫描数据格式" class="headerlink" title="9. 扫描数据格式"></a><font size=3>9. 扫描数据格式</font></h2><p>扫描数据按照MCU顺序存储，当编码后数据出现0xFF时，为了避免与JPEG关键字冲突，需要在其后补充0x00，即每个单字节0xFF会存储为0xFF00两个字节。</p>
<p>当JPEG文件支持DRI，则需要按照DRI的值，每隔该值指示的周期，MCU内的直流分量重新开始差分计算，同时需要在周期结束的数据后面增加RSTn(0xFFD0-D7)标记，标记循环添加，不能跳过。最后一个周期结束为0xFFD9不需要添加RSTn。</p>
<p>由DRI指示的多个MCU构成一个slice，一个slice的数据可以独立解码。</p>
<p>当一个周期结束时，此时写入的bit数据不满一个字节时，需要将剩余字节填充为1b。</p>
<h1 id="四、JPEG标准与文件格式"><a href="#四、JPEG标准与文件格式" class="headerlink" title="四、JPEG标准与文件格式"></a><font size=3>四、JPEG标准与文件格式</font></h1><p>我们重新看一下JPEG的概念：JPEG是联合图象专家组(Joint Picture Expert Group)的英文缩写，是国际标准化组织(ISO)和CCITT联合制定的静态图象的<strong>压缩编码标准</strong>。</p>
<p>我们通常说的JPEG指的是以JPEG格式压缩的图片(即文件后缀为<code>.jpeg</code> <code>.jpe</code> )。经过JPEG重新编码的图片，文件压缩率可以达到90%以上，而且图片本身还具有较好的图片质量。这也是JPEG成为目前互联网上被用来存储和传输图片应用最广泛的格式的一个重要原因。</p>
<p>JPEG本身只有描述如何将一个视频&#x2F;图片转换为字节的数据流（streaming），但并没有说明这些字节如何在任何特定的存储媒体上被封存起来。</p>
<p>很多人会把JPEG标准和JPEG文件格式理解成一个东西。然而实际并不是这样的，JPEG标准主要还是围绕编解码的部分（如DCT变换、量化、哈夫曼树等等），虽然在JPEG标准中也定义了“<strong>JPEG Interchange Format (JIF)<strong>”的文件存储格式，但是因为Encoder和Decoder完整实现 JIF 很困难，且 JIF 标准也存在一些缺陷，因此JIF并没有被推广开来。倒是后来出现的“</strong>JPEG File Interchange Format</strong> (JFIF)” 和 “**Exchange image file Format(**Exif)” 等新的存储格式成为了主流。Exif 也好 JFIF 也罢，他们都是遵循 JIF 标准的，两者只是在 JIF 的基础上增加了一些各自的Marker。</p>
<ul>
<li><strong>JPEG是压缩标准，JPEG&#x2F;JFIF和JPEG&#x2F;Exif是文件格式标准</strong>，不是一个概念，需要注意区分。</li>
<li>JPEG&#x2F;Exif文件格式标准是Camera产业联合会发布，主要用于摄像设备上，摄像产业把Exif作为行业的元数据（metadata)交换格式</li>
<li>JPEG&#x2F;JFIF文件格式标准是为了方便JPEG压缩图像在广泛的平台和应用间以最小的存储空间代价进行交换而设计的，它不包含JPEG&#x2F;TIFF标准任何高级特性。</li>
</ul>
<p>上面学习JPEG中段的概念的时候，实例使用的就是一张符合JFIF格式标准的jpg图片。</p>
<h1 id="五、多Slice拼接"><a href="#五、多Slice拼接" class="headerlink" title="五、多Slice拼接"></a><font size=3>五、多Slice拼接</font></h1><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/04%E9%9F%B3%E8%A7%86%E9%A2%91/LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/LV01-%E5%9B%BE%E5%83%8F-03-%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F-03-03-JPEG%E5%8D%8F%E8%AE%AE%E4%BB%8B%E7%BB%8D/img/image-20240730073730286.png" alt="image-20240730073730286" style="zoom:50%;" />

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/209e45b7.html">LV01-图像-03-图片格式-03-03-JPEG协议介绍</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2024年07月30日 - 07:49</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/209e45b7.html" title="LV01-图像-03-图片格式-03-03-JPEG协议介绍">https://sumumm.github.io/post/209e45b7.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/ALPHA-LV01-%E5%9B%BE%E5%83%8F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" rel="tag"><i class="fa fa-tag"></i> (ALPHA)LV01-图像基础知识</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/49c90c14.html" rel="prev" title="LV04-01-加密基础-01-加密算法简介">
                  <i class="fa fa-angle-left"></i> LV04-01-加密基础-01-加密算法简介
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/23c4a364.html" rel="next" title="LV01-图像-03-图片格式-03-02-JPEG编解码">
                  LV01-图像-03-图片格式-03-02-JPEG编解码 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
